function MeasureOut(Path,ZLayers,CellGroups,Masks,ScatterMasks,GaussianDeback)
import OBT5.*
Reader=OmeBigTiff5D(Path,CreationDisposition.TryOpen);
[~,Order]=ismember('YXCTZ',Reader.DimensionOrder);
Data=permute(Reader.ReadPixels5D,Order);
HasScatter=exist('ScatterMasks','var');
if HasScatter
	if exist('GaussianDeback','var')
		GaussianDeback=imgaussfilt(Data,GaussianDeback);
		Data=Data-GaussianDeback+mean(GaussianDeback,[1 2]);
	elseif ~iscell(ScatterMasks)
		ScatterMasks=imgaussfilt(Data,ScatterMasks);
		Data=Data-ScatterMasks+mean(ScatterMasks,[1 2]);
		ScatterMasks=[];
	end
else
	ScatterMasks=[];
end
[SizeG,SizeZ]=size(Masks);
[SizeY,SizeX]=size(Data,1,2);
Data=reshape(Data-min(0,min(Data,[],"all")),SizeY*SizeX,[],SizeZ);
[Directory,Name]=fileparts(Path);
Path=fullfile(Directory,Name);
Measurements=cell(SizeG,SizeZ);
for Z=1:SizeZ
	ZData=Data(:,:,Z);
	for G=1:SizeG
		M=Masks{G,Z}*ZData;
		if HasScatter
			Scatters=ScatterMasks{G,Z}*ZData;
			M=M-Scatters+mean(Scatters,2);
		end
		Measurements{G,Z}=M;
	end
end
MATLAB.General.Save(sprintf('%s.测量.mat',Path),'Measuremets',cell2table(Measurements,RowNames=CellGroups,VariableNames=ZLayers),'Version',CaProcessing.Version);